package org.osoftware.mumi.dao.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * The Class AttentionTimeGroup.
 */
@Entity
@Table(name="attention_time_group")
public class AttentionTimeGroup extends BaseObject {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 4945328417816013922L;
	
	/** The description. */
	@Column(name="description")
	private String description;
	
	/** The patient. */
	@ManyToOne
    @JoinColumn(name = "patient_id", updatable = false, insertable = false, nullable=false)
	private Patient patient;
	
	/** The payment plan. */
	@OneToOne(cascade=CascadeType.ALL)
	private PaymentPlan paymentPlan;
	
	/** The attention times. */
	@OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name = "attention_time_group_id", updatable = false, insertable = false, nullable=false)
	private List<AttentionTime> attentionTimes;
	
	
	
	/**
	 * Gets the attention times.
	 *
	 * @return the attention times
	 */
	public List<AttentionTime> getAttentionTimes() {
		return attentionTimes;
	}

	/**
	 * Sets the attention times.
	 *
	 * @param attentionTimes the new attention times
	 */
	public void setAttentionTimes(List<AttentionTime> attentionTimes) {
		this.attentionTimes = attentionTimes;
	}

	/**
	 * Gets the description.
	 *
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	
	/**
	 * Sets the description.
	 *
	 * @param description the new description
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	
	/**
	 * Gets the patient.
	 *
	 * @return the patient
	 */
	public Patient getPatient() {
		return patient;
	}
	
	/**
	 * Sets the patient.
	 *
	 * @param patient the new patient
	 */
	public void setPatient(Patient patient) {
		this.patient = patient;
	}
	
	/**
	 * Gets the payment plan.
	 *
	 * @return the payment plan
	 */
	public PaymentPlan getPaymentPlan() {
		return paymentPlan;
	}
	
	/**
	 * Sets the payment plan.
	 *
	 * @param paymentPlan the new payment plan
	 */
	public void setPaymentPlan(PaymentPlan paymentPlan) {
		this.paymentPlan = paymentPlan;
	}

	/* (non-Javadoc)
	 * @see org.osoftware.mumi.dao.model.BaseObject#toString()
	 */
	@Override
	public String toString() {
		return "AttentionTimeGroup [description=" + description + ", patient="
				+ patient + ", paymentPlan=" + paymentPlan + ", toString()="
				+ super.toString() + "]";
	}
	
	
}
